package com.example.order.mapper;

import com.example.order.domain.dto.OrderListDTO;
import com.example.order.domain.po.Order;
import com.example.order.domain.vo.OrderListVO;
import com.example.order.domain.vo.OrderVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderMapper {

    /**
     * 插入订单
     * @param order
     */
    void insertOrder(Order order);

    /**
     * 获取订单
     * @param id
     * @return
     */
    @Select("select id,address_id,buyer_message,status,create_time,pay_time,total_fee,post_fee," +
            "pay_money from orders where id = #{id}")
    Order selectOrderDetail(Long id);

    /**
     * 更新订单状态
     * @param order 订单对象
     */

    void updateOrderStatus(Order order);

    /**
     * 删除订单
     * @param ids
     */
    void deleteOrder(Long []ids);

    /**
     * 获取订单列表
     * @param order
     * @return
     */
    Page<OrderListVO> selectOrderList(Order order);


}
